#pragma once
#include <QString>
#include "data_xml_container.hpp"

namespace Data
{
    class Track: public XmlContainer
    {
    public:
        enum Type { WAVE, SYNTH, MIX };
        Track();

        QString name() const;
        void setName(QString);

        Type type() const;
        void setType(Type);

        float volume() const; // in dB
        void setVolume(float);

        float balance() const; // -1 left, 0 center, 1 right
        void setBalance(float);

        bool isLock() const;
        void setIsLock(bool);

        bool isRecord() const;
        void setIsRecord(bool);

        bool isMute() const;
        void setIsMute(bool);

        bool isSolo() const;
        void setIsSolo(bool);

        void toXml(QDomElement &);
        void fromXml(QDomElement &);
    private:
        QString name_;
        Type type_;
        float volume_;
        float balance_;
        bool isLock_;
        bool isRecord_;
        bool isMute_;
        bool isSolo_;
    };
}
